package com.success;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableDiscoveryClient // 开启EurekaClient功能
@EnableFeignClients // 开启Feign功能
public class SpringcloudOrderServer4000Application {

    public static void main(String[] args) {
        SpringApplication.run(SpringcloudOrderServer4000Application.class, args);
    }

    //这是使用什么负载均衡策略（可以在配置文件中配置
    @Bean
    public IRule getRandomRule(){
        return new RandomRule();
    }
}
